package com.hq.shop10search.controller;

import com.hq.commons.ov.Goods;
import com.hq.shop10search.service.GoodsService;
import com.hq.shop10search.vo.SearchGoodsParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.io.IOException;
import java.util.List;

@Controller
@RequestMapping("/searchGoodsController")
public class SearchGoodsController {

    @Autowired
    private GoodsService goodsService;

    @RequestMapping("search")
    public String search(SearchGoodsParam searchGoodsParam, ModelMap modelMap) throws IOException {
        List<Goods> goodsList = goodsService.seach(searchGoodsParam);
        modelMap.put("goodsList",goodsList);
        return "searchList";
    }
}
